package unit3_1013.test3;

import java.util.Scanner;

public class Test {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		
		Scanner scanner = new Scanner(System.in);
		System.out.println("宠物种类:\n1.狗\t2.猫");
		
		System.out.print("请选择:");
		int choice = scanner.nextInt();
		switch (choice) {
		case 1:
			Dog dog = new Dog();
			Class<? extends Dog> class1 = dog.getClass();
			System.out.println(class1);
			System.out.print("请输入宠物狗的昵称:");
			dog.setName(scanner.next());
			System.out.print("请输入宠物的性别:1.雄\t2.雌--->");
			int sexInt = scanner.nextInt();
			dog.setSex(sexInt==1?"雄":"雌");
			System.out.print("请输入宠物狗的健康值(1-100):");
			dog.setHealth(scanner.nextInt());
			System.out.print("请输入主人与宠物狗的亲密度(1-10):");
			dog.setLove(scanner.nextInt());
			dog.show();
			break;
		case 2:
			Cat cat = new Cat();
			System.out.print("请输入宠物猫的昵称:");
			cat.setName(scanner.next());
			System.out.print("请输入宠物的性别:1.雄\t2.雌--->");
			int sexInt2 = scanner.nextInt();
			cat.setSex(sexInt2==1?"雄":"雌");
			System.out.print("请输入宠物猫的健康值(1-100):");
			cat.setHealth(scanner.nextInt());
			System.out.print("请输入宠物猫的懒度(1-10):");
			cat.setLazy(scanner.nextInt());
			cat.show();
			break;
		default:
			System.out.println("输入非法");
			break;
		}
		
		
	}

}
